package org.jeecg.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.domain.OrdersServe;
import org.jeecg.domain.dto.OrderDto;
import org.jeecg.domain.vo.OrderVo;
import org.jeecg.service.OrdersServeService;
import org.jeecg.mapper.OrdersServeMapper;
import org.jeecg.utils.ResponseResult;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
* @author 86182
* @description 针对表【orders_serve(服务单表)】的数据库操作Service实现
* @createDate 2024-12-25 18:17:13
*/
@Service
public class OrdersServeServiceImpl extends ServiceImpl<OrdersServeMapper, OrdersServe>
    implements OrdersServeService{
    //    服务数据 分页
    @Override
    public ResponseResult orderList(OrderDto orderDto) {
        IPage<OrderVo> page = new Page<>(orderDto.getPageNum(), orderDto.getPageSize());
        List<OrdersServe> list = this.list(Wrappers.<OrdersServe>lambdaQuery().eq(OrdersServe::getServeProviderId, orderDto.getServeProviderId()));
        ArrayList<OrderVo> orderVos = new ArrayList<>();
        for (OrdersServe ordersServe : list) {

        }
        LambdaQueryWrapper<OrderVo> wrapper = Wrappers.<OrderVo>lambdaQuery().eq(OrderVo::getServeProviderId, orderDto.getServeProviderId());
//        this.page(page, wrapper);
        List<OrderVo> records = page.getRecords();
        for (OrderVo record : records) {

        }
        return ResponseResult.okResult(page);
    }
}




